int foo(int k)
{
 if (k < 1 || k > 2) {
   printf("out of range\n");
   printf("this function requires a value of 1 or 2\n");
 } else {
   printf("Switching\n");
   switch (k) {
     case 1:
       printf("1\n");
       break;
     case 2:
       printf("2\n");
       break;
   }
 }
}
